package com.woniuxy.microloanserver.dao;


import com.woniuxy.microloanserver.bean.LoanOrderBean;
import com.woniuxy.microloanserver.bean.LoanOrderStageBean;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
/*
 * Description :   贷款订单相关数据持久层接口
 * ChangeLog : 1. 创建 (2021/4/19 14:55 );
 * @param null  
 * @return null
 */

@Mapper
public interface LoanOrderDao {

    /*
     * Description :   新增借款订单数据
     * ChangeLog : 1. 创建 (2021/4/19 21:28 );
     * @param loanOrderBean 订单对象
     * @return int 影响行数
     */
    int addOrder(LoanOrderBean loanOrderBean);

    /*
     * Description :   新增订单分期数据
     * ChangeLog : 1. 创建 (2021/4/20 11:05 );
     * @param loanOrderStageBean    订单分期对象
     * @return int  影响行数
     */
    @Insert("INSERT INTO loan_order_stage(fk_loan_order_number, fk_user_id, tot_pmts, principal, provider, interest, service_charge) " +
            "VALUES (#{fkLoanOrderNumber}, #{fkUserId}, #{totPmts}, #{principal},#{provider}, #{interest}, #{serviceCharge})")
    int addOrderStage(LoanOrderStageBean loanOrderStageBean);


}
